home *** CD-ROM | disk | FTP | other *** search
- Path: alpha.isc.rit.edu!MJP3783
- From: mjp3783@alpha.isc.rit.edu
- Newsgroups: comp.sys.amiga.programmer
- Subject: Re: Is this a SAS/C bug or have I coded it wrong?
- Date: 6 Jan 1996 16:56:44 GMT
- Organization: Rochester Institute of Technology
- Message-ID: <4cm9kc$kf7@news.isc.rit.edu>
- References: <4cfrc5$gsc@misery.millcomm.com>
- Reply-To: mjp3783@alpha.isc.rit.edu
- NNTP-Posting-Host: alpha.isc.rit.edu
-
- In article <4cfrc5$gsc@misery.millcomm.com>, llucius@millcomm.com (Yambo) writes:
- >Is this a SAS/C bug or am I getting more blind???
- >
- >=========================================================================
- >The following code:
- >=========================================================================
- >
- > tmpbuf[10];
- >
- > int
-
- I assume this was a mis-type and that this should have been:
- int tmpbuf[10];
-
-
- > test( void )
- > {
- >
- > if ( tmpbuf[0] & 0x1f == 1 )
- > return 1;
- >
- > return 0;
- > }
-
- No, this is not a bug, this is optimization. If I type:
- if (1==2) a(); else b();
-
- isn't that, really, the same as
- b();
- ???
-
- >
- >=========================================================================
- >Produces:
- >=========================================================================
- > SECTION text,CODE
- > __code:
- > test:
- > ___test__1:
- > MOVEQ.L #$0,D0 ;7000
- > ___test__2:
- > RTS ;4e75
- > __const:
- > __strings:
- > XDEF test
- >
- > SECTION __MERGED,BSS
- > __MERGEDBSS
- > tmpbuf:
- > DS.B 40
- > XDEF tmpbuf
- > END
- >=========================================================================
- >Is this right? Where'd the "IF" go? Do I have it coded wrong?
- >
- >TIA
- >
- >--
- >__ Y_ a_ m_ b_ o_ | The leanest, meanest, fightinest sweet tater on Earth!
- > oo o oo o o |
- > o o o | llucius@millcomm.com
- > o oo o o |
- >-- -- -- -- -- -- | http://www.millcomm.com/~llucius/index.html (coming soon)
- >
-